package com.landinfo.domain;

import com.vividsolutions.jts.geom.LineString;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 样线监测模板
 * Create by wj
 * 2018-10-31
 */
@ApiModel(description = "样线监测模板 Create by wj 2018-10-31")
@Entity
@Table(name = "sample_line_monitor")
//@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SampleLineMonitor implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 样线名称
     */
    @ApiModelProperty(value = "样线名称")
    @Column(name = "name")
    private String name;

    /**
     * 起始点地名
     */
    @ApiModelProperty(value = "起始点地名")
    @Column(name = "start_place_name")
    private String startPlaceName;

    /**
     * 终点地名
     */
    @ApiModelProperty(value = "终点地名")
    @Column(name = "end_place_name")
    private String endPlaceName;

    /**
     * 巡护里程（米）
        */
    @ApiModelProperty(value = "巡护里程")
    @Column(name = "distance")
    private Integer distance;

    /**
     * 监测样线人员
     */
    @ApiModelProperty(value = "监测样线人员")
    @Column(name = "monitor_persons")
    private String monitorPersons;

    /**
     * 是否启用该样线
     */
    @ApiModelProperty(value = "是否启用该样线")
    @Column(name = "jhi_enable")
    private Boolean enable;

    /**
     * 监测样线（线类型）
     */
    @ApiModelProperty(value = "监测样线")
    @Column(name = "geometry")
    private LineString geometry;

    /**
     * 排序字段
     */
    @ApiModelProperty(value = "排序字段")
    @Column(name = "sort")
    private Integer sort;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public SampleLineMonitor name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStartPlaceName() {
        return startPlaceName;
    }

    public SampleLineMonitor startPlaceName(String startPlaceName) {
        this.startPlaceName = startPlaceName;
        return this;
    }

    public void setStartPlaceName(String startPlaceName) {
        this.startPlaceName = startPlaceName;
    }

    public String getEndPlaceName() {
        return endPlaceName;
    }

    public SampleLineMonitor endPlaceName(String endPlaceName) {
        this.endPlaceName = endPlaceName;
        return this;
    }

    public void setEndPlaceName(String endPlaceName) {
        this.endPlaceName = endPlaceName;
    }

    public String getMonitorPersons() {
        return monitorPersons;
    }

    public SampleLineMonitor monitorPersons(String monitorPersons) {
        this.monitorPersons = monitorPersons;
        return this;
    }

    public void setMonitorPersons(String monitorPersons) {
        this.monitorPersons = monitorPersons;
    }

    public Boolean isEnable() {
        return enable;
    }

    public SampleLineMonitor enable(Boolean enable) {
        this.enable = enable;
        return this;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SampleLineMonitor sampleLineMonitor = (SampleLineMonitor) o;
        if (sampleLineMonitor.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), sampleLineMonitor.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "SampleLineMonitor{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", startPlaceName='" + getStartPlaceName() + "'" +
            ", endPlaceName='" + getEndPlaceName() + "'" +
            ", monitorPersons='" + getMonitorPersons() + "'" +
            ", enable='" + isEnable() + "'" +
            "}";
    }

    public LineString getGeometry() {
        return geometry;
    }

    public void setGeometry(LineString geometry) {
        this.geometry = geometry;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}
